package com.project_doctor.controller;

import com.project_doctor.pojo.*;
import com.project_doctor.pojo.Package;
import com.project_doctor.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

@RestController
@RequestMapping("/dropdown")
public class DropdownController {
    @Autowired
    private StatusService statusService;
    @Autowired
    private InstitutionService institutionService;
    @Autowired
    private TeamService teamService;
    @Autowired
    private PackageService packageService;
    @Autowired
    private DoctorService doctorService;
    @Autowired
    private ServiceService  serviceService ;
    @Autowired
    private TagService  tagService;
    @Autowired
    private AddressService  addressService  ;
    @Autowired
    private ResidentService residentService;
    @Autowired
    private ServiceTypeService serviceServiceType ;


    //待处理服务状态下拉框
    @GetMapping("/getStatus")
    public ResponseEntity<?> getStatus() {
        List<Integer> list = Arrays.asList(1, 2, 4, 9, 10);
        List<Status> status = statusService.getStatus(list);
        return ResponseEntity.ok(status);
    }
    //服务记录状态下拉框
    @GetMapping("/getStatusRecord")
    public ResponseEntity<?> getStatusRecord() {
        List<Integer> list = Arrays.asList(9, 10);
        List<Status> status = statusService.getStatus(list);
        return ResponseEntity.ok(status);
    }
    //服务机构下拉框
    @GetMapping("/getInstitution")
    public ResponseEntity<?> getInstitution() {
        List<Institution> institution = institutionService.getInstitution();
        return ResponseEntity.ok(institution);
    }
    //医生团队下拉框
    @GetMapping("/getTeam")
    public ResponseEntity<?> getTeam() {
        List<Team> team = teamService.getTeam();
        return ResponseEntity.ok(team);
    }
    //服务包下拉框
    @GetMapping("/getPackage")
    public ResponseEntity<?> getPackage() {
        List<Package> packages = packageService.getPackage();
        return ResponseEntity.ok(packages);
    }
    //医生下拉框
    @GetMapping("/getDoctor")
    public ResponseEntity<?> getDoctor() {
        List<Doctor> doctor = doctorService.getDoctor();
        return ResponseEntity.ok(doctor);
    }
    //服务项目下拉框
    @GetMapping("/getService")
    public ResponseEntity<?> getService() {
        List<Service> service = serviceService.getService();
        return ResponseEntity.ok(service);
    }
    //居民标签下拉框
    @GetMapping("/getTagStatus")
    public ResponseEntity<?> getTagStatus() {
        List<Tag> tag = tagService.getTagStatus();
        return ResponseEntity.ok(tag);
    }
    //服务地点下拉框
    @GetMapping("/getAddress")
    public ResponseEntity<?> getAddress() {
        List<Address> addresses = addressService.getAddress();
        return ResponseEntity.ok(addresses);
    }
    //用户名下拉框
    @GetMapping("/getResident")
    public ResponseEntity<?> getResident() {
        List<Resident> resident = residentService.getResident();
        return ResponseEntity.ok(resident);
    }
    //服务项目类型下拉框
    @GetMapping("/getServiceType")
    public ResponseEntity<?> getServiceType() {
        List<ServiceType> serviceType = serviceServiceType.getServiceType();
        return ResponseEntity.ok(serviceType);
    }
}
